#coding:utf-8
from django.conf.urls import url
from django.urls import path,re_path
from blog import views

app_name = 'blog'
urlpatterns = [

    url(r'test/',views.test,name='test'),
    url(r'^ArticleListView/', views.ArticleListView.as_view(),name='article_list'),
    url(r'^article/(?P<pk>\d+)/(?P<slug1>[-\w]+)/$', views.ArticleDetailView.as_view(), name='article_detail'),
    url(r'^ArticleCreateView/',views.ArticleCreateView.as_view(),name='article_create'),
    url(r'^article/(?P<pk>\d+)/(?P<slug1>[-\w]+)/update/$',views.ArticleUpdateView.as_view(), name='article_update'),
    url(r'^article/(?P<pk>\d+)/(?P<slug1>[-\w]+)/delete$',views.ArticleDeleteView.as_view(), name='article_delete'),
    url(r'^article/(?P<pk>\d+)/(?P<slug1>[-\w]+)/$',views.ArticleCommentView.as_view(), name='article_comment'),

    url(r'^article_search/',views.article_search,name='search'),
    # չʾ�������� - ��¼/δ��¼����

    # �ݸ��� - ��Ҫ��¼
    path('draft/', views.ArticleDraftListView.as_view(), name='article_draft_list'),
    # �ѷ��������б�(���༭) - ��Ҫ��¼
    path('admin/', views.PublishedArticleListView.as_view(), name='published_article_list'),

    # �������� - ��Ҫ��¼
    #re_path(r'^article/create/$',views.ArticleCreateView.as_view(), name='article_create'),
    # �������� - ��Ҫ��¼
    re_path(r'^article/(?P<pk>\d+)/(?P<slug1>[-\w]+)/publish/$',views.article_publish, name='article_publish'),
    # ɾ������ - ��Ҫ��¼

    # չʾ����б�
   url(r'^category/$',views.CategoryListView.as_view(), name='category_list'),
    # չʾ�������
   url(r'^category/(?P<slug>[-\w]+)/$',views.CategoryDetailView.as_view(), name='category_detail'),
    # չʾTag����
    re_path(r'^tags/(?P<slug>[-\w]+)/$',views.TagDetailView.as_view(), name='tag_detail'),
    # ��������
    re_path(r'^search/$', views.article_search, name='article_search'),
]
